import {
  ArticleContentDataVersion,
  ArticleContentDataType,
} from "../enum/article-content-data";

export interface ArticleContentNodeV1 {
  type: string;
  value: string | ArticleContentNodeV1[] | { [key: string]: string };
  alt?: string;
}
export interface ArticleContentNode {
  // 兼容
  type: string;
  value?: string | ArticleContentNodeV1[] | { [key: string]: string };

  tagName: string | "#text";
  textContent?: string; // 文本内容
  // a 标签属性
  href?: string; // 链接的href
  // 图片属性
  src?: string; // 图片的src
  alt?: string; // 图片的alt

  children?: ArticleContentNode[];
}

export interface ArticleContentData {
  type: ArticleContentDataType;
  version?: ArticleContentDataVersion;
  content?: ArticleContentNode[] | string;
}
